package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zhentao.mapper.BuUserMapper;
import com.zhentao.mapper.MaUserMapper;
import com.zhentao.model.common.app.pojo.ApUser;
import com.zhentao.model.common.buiness.dto.BuUserLoginDto;
import com.zhentao.model.common.buiness.dto.MaBuinessUserDto;
import com.zhentao.model.common.buiness.pojo.BuUser;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.common.enums.AppHttpCodeEnum;
import com.zhentao.service.BuUserService;
import com.zhentao.service.MaUserService;
import com.zhentao.utils.common.AppJwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author 薄超轩
* @description 针对表【bu_user】的数据库操作Service实现
* @createDate 2024-09-14 11:28:41
*/
@Service
public class MaUserServiceImpl implements MaUserService {
    @Autowired
    private MaUserMapper mapper;


    @Override
    public ResponseResult maAudit(BuUser buUser) {
        buUser.setStatus(1);
        mapper.updateById(buUser);
        return ResponseResult.okResult("修改成功");
    }

    @Override
    public ResponseResult findAll(MaBuinessUserDto dto) {
        LambdaQueryWrapper<BuUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(BuUser::getUsername,dto.getUsername());
        wrapper.like(BuUser::getPhone,dto.getPhone());
        List<BuUser> buUsers = mapper.selectList(wrapper);
        return ResponseResult.okResult(buUsers);
    }
}




